package com.ruibang.glass.etl.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.math.BigInteger;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;

import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * <p>
 * 
 * </p>
 *
 * @author Auto-generator
 * @since 2024-04-19
 */

@ApiModel(value ="")
@TableName("bc_station_fx_detail")
@Data
public class BcStationFxDetail {

    @TableId(value = "_id")
    private String id;
    @TableField("FX_GlassID_IN")
    private String fxGlassidIn;
    @TableField("FZFXJ_GlassID")
    private String fzfxjGlassid;
    @TableField("FXJQR_GlassID")
    private String fxjqrGlassid;
    @TableField("FX_GlassID_OUT")
    private String fxGlassidOut;
    @TableField("FX_equipment_status")
    private String fxEquipmentStatus;
    @TableField("GlassID")
    private String GlassID;
    @TableField("FX_operation_mode")
    private String fxOperationMode;
    @TableField("FZCJJ_GlassID")
    private String fzcjjGlassid;
    private String stationStartTime;
    @TableField("FXJQR_equipment_status")
    private String fxjqrEquipmentStatus;
    private String fxFxjqrQbwForward;
    private String stationCompleteTime;
    @TableField("FXJQR_operation_mode")
    private String fxjqrOperationMode;
    private String fxParam1;
    private String stationProductionTime;
    private String fxFxjqrQbwUp;
    private String fxFxjqrXbwLeft;
    private String fxFxjqrQbwSsz;
    private String fxFxjqrQbwDown;
    private String fxFxjqrXbwUp;
    private String fxFxjqrXbwDown;
    private String fxFxjqrCjwDown;
    private String fxFxjqrXbwForward;
    private String fxFxjqrXbwSsz;
    private String fxFxjqrCjwForward;
    private String fxFxjqrQbwToleft;
    private String fxFxjqrCjwLeft;
    private String fxFxjqrXbwToleft;
    private String fxQzjqrUp;
    private String fxQzjqrDown;
    private String fxFxjqrCjwToleft;
    private String fxFxjqrCjwSsz;
    private String fxQzjqrToleft;
    @TableField("CJ_broken")
    private String cjBroken;
    private String fxFxjqrQbwLeft;
    private String fxFxjqrCjwUp;
    private String fxQzjqrSsz;
    private String fxQzjqrLeft;
    private String fxZkylXz2;
    @TableField("FXJQR_fx")
    private String fxjqrFx;
    private String fxQzjqrForward;
    private String fxZkylXz1;
    private String order;
    @TableField("FX_robot_state")
    private String fxRobotState;
    @TableField("FX_broken")
    private String fxBroken;
    @TableField("CJ_state")
    private String cjState;
    @TableField("FX_Lost_board_count")
    private String fxLostBoardCount;
    private String fxZkylGlass11;
    private String unbind;
    private String fxZkylXz4;
    private String fxZkylXz3;
    @TableField("Aframe_change_over")
    private String aframeChangeOver;
    private String fxZkylGlass4;
    private String rackState;
    @TableField("FXJQR_cj")
    private String fxjqrCj;
    private String fxZkylGlass8;
    private String fxZkylGlass5;
    @TableField("FX_cj_count")
    private String fxCjCount;
    private String fxZkylGlass9;
    private String fxZkylGlass6;
    private String fxZkylGlass12;
    private String fxZkylGlass1;
    private String fxZkylGlass7;
    private String fxZkylGlass10;
    private String rackId;
    private String fxZkylGlass2;
    private String fxZkylGlass3;
    private String rackTime;
    private String rackParam;
    @TableField("Aframe_change_start")
    private String aframeChangeStart;
    private String fxSpeed;
    private String aframeBroken;
    private String fxBljg;
    private String productionLineCode;
    private String stationId;
    private String tag;
    private String glassId;
    private String tagOut;
    private String stationStartTimeOrg;
    private String stationCompleteTimeOrg;
    private String station;
    private String table;
    private String dataType;
    private String createTime;
    @TableField("tagText")
    private String tagText;
    public void setCreateTime(String createTime){

        this.createTime = createTime;
    }


    public String getCreateTime(){
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        if(StringUtils.isNotBlank(createTime) && createTime.matches("\\d+")){
            Instant instant = Instant.ofEpochMilli(Long.parseLong(createTime));
            ZoneId zone = ZoneId.systemDefault();
            return LocalDateTime.ofInstant(instant, zone).format(formatter);
        }
        return LocalDateTime.now().format(formatter);
    }
}
